Merge main + migrate parser to ParsedToolCall API#1
Merged
RNabel merged 7 commits intoMay 13, 2026
Merged
Conversation
Brings in ParsedToolCall API (#22), hatch-vcs versioning (#20), Apache 2.0 license (#27), and other commits landed after the PR branched. Resolves conflicts in renderers/__init__.py, renderers/base.py, renderers/parsing.py, and tests/test_roundtrip.py by taking main's ParsedToolCall shape and re-applying the Laguna additions on top.
…t_never After merging main, the Laguna parser was still on the old ``list[dict]`` shape and 4 tests failed against ``ParsedResponse.tool_calls``'s new ``list[ParsedToolCall]`` type (introduced in #22). Mirror ``parse_glm``'s structure: emit ``ParsedToolCall`` with a ``status`` enum (UNCLOSED_BLOCK / MISSING_NAME / INVALID_JSON / OK) and a ``token_span`` relative to the stop-stripped stream. Also drop ``assert_never(unexpected_role)``: ``msg["role"]`` is plain ``str`` (TypedDict), so ``ty`` flags a type-assertion-failure and any unknown role would crash at runtime — every other renderer silently skips unknown roles. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
767e853 to
9e59cc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sending this as a PR against your branch so you can review + merge, since
maintainerCanModifyis a no-op for org-owned forks (poolsideai is an org, so direct push from the upstream side was denied).Summary
origin/maininto the branch. The PR was opened before feat(parsing): per-attempt ParsedToolCall with status + token spans PrimeIntellect-ai/renderers#22 (ParsedToolCallmigration), build: derive version from git tags via hatch-vcs PrimeIntellect-ai/renderers#20 (hatch-vcs), and chore: license under Apache 2.0 PrimeIntellect-ai/renderers#27 (Apache 2.0) landed; merging brings them in.parse_laguna_xs2to the new API.ParsedResponse.tool_callsis nowlist[ParsedToolCall](always a list, with per-attemptstatus+token_span). The Laguna parser was still on the oldlist[dict]shape and 4 tests failed after the merge. Mirroredparse_glm's structure — setsUNCLOSED_BLOCK/MISSING_NAME/INVALID_JSON/OKand computes spans relative to the stop-stripped stream.assert_never(unexpected_role)inLagunaXS2Renderer.render.msg["role"]is plainstr(TypedDict), sotyflags atype-assertion-failureat static-check time and any unknown role would crash at runtime — every other renderer in the repo silently skips unknown roles.Test plan
uv run pytest tests/ -k Laguna→ 53/53 passuv run pytest tests/test_render_ids.py tests/test_parse_response.py tests/test_parse_response_robustness.py tests/test_roundtrip.py tests/test_preserve_thinking.py→ 784 passed, 43 skipped (gpt-oss HF-parity skips), 1 xfailuv run ruff check renderers/ tests/cleanuv run ruff format --check renderers/ tests/cleanuv run ty check renderers/laguna_xs2.pyno Laguna-specific diagnostics🤖 Generated with Claude Code